<?php
namespace app\examScore\model;
use think\Model;
use think\Db;

class ExamScoreModel extends Model{
    
	public function getGetidefenParam($examId, $subject){
        $where["ID"] = $examId;
        $exam = Db::table("考试名称")
                ->field("年级ID gradeId,考试名称 examName")
                ->where($where)
                ->find();
        $type = "期末";
        if(!strpos($exam["examName"],$type)){
            $type = "月测";
        }
        $twhere["年级"] = $exam["gradeId"];
        $twhere["学科"] = $subject;
        $data = Db::table("考试题型分值")
                ->field($type." type")
                ->where($twhere)
                ->find();
        return $data["type"];
	}

}
